#!/bin/bash
# 配置系统
pacman -S neovim iwd ttf-dejavu sudo bluez usbmuxd networkmanager dhcpcd wqy-zenhei

# neovim软链接
ln -s /bin/nvim /bin/vim
ln -s /bin/nvim /bin/vi

# 设置时区和时间
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
hwclock --systohc

# 设置语言
echo en_US.UTF-8 URF-8 >> /etc/locale.gen
echo en_US ISO-8859-1 >> /etc/locale.gen
echo zh_CN.GB18030 GB18030 >> /etc/locale.gen
echo zh_CN.GBK GBK >> /etc/locale.gen
echo zh_CN.UTF-8 UTF-8 >> /etc/locale.gen
echo zh_CN GB2312 >> /etc/locale.gen

locale-gen
echo LANG=zh_CN.UTF-8 >> /etc/locale.conf

# 设置主机名
echo lovectrl >> /etc/hostname

# 设置网络
echo "127.0.0.1 localhost" >> /etc/hosts
echo "::1 localhost" >> /etc/hosts
echo "127.0.1.1 lovectrl.localdomain lovectrl" >> /etc/hosts

# 安装引导并重启系统
pacman -S grub efibootmgr

# 双系统引导（先安装windows，再安装arch）
pacman -S os-prober
echo GRUB_DISABLE_OS_PROBER=false >> /etc/default/grub
grub-install /dev/$1

grub-mkconfig -o /boot/grub/grub.cfg

# 设置密码
passwd
exit
